# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>

pkgname=deepin-session-ui
pkgver=5.6.2
pkgrel=2
pkgdesc='Deepin desktop-environment - Session UI module'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/dde-session-ui"
license=('GPL3')
groups=('deepin')
depends=('gsettings-qt' 'deepin-qt5integration' 'liblightdm-qt5' 'qt5-svg' 'deepin-daemon'
         'deepin-control-center' 'deepin-wallpapers')
makedepends=('cmake' 'deepin-gettext-tools' 'gtest' 'ninja')
source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/dde-session-ui/archive/$pkgver.tar.gz")
sha512sums=('70944d3b0ac17ccbcc3c3d779f89fb26e6bc6b26bcc28696449dcdccaa823c2c07fc630de00ac1af71030617b91accaadf47b90b8373ad17d1fe8b9db104ca61')

prepare() {
  mkdir -p build

  cd dde-session-ui-$pkgver
  sed -i 's|/usr/share/backgrounds/default_background.jpg|/usr/share/backgrounds/deepin/desktop.jpg|' widgets/*.cpp
}

build() {
  cd build
  cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr ../dde-session-ui-$pkgver
  ninja
}

check() {
  cd build
  # ninja test
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
}
